package cn.tank.data.sync.server.redis;

import cn.tank.data.sync.redis.RedisMessagePublisher;
import cn.tank.data.sync.redis.common.Channel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/************************************************
 * @Description:消息发送测试
 * @Version: 1.0
 ************************************************/
public class MessageSendTest {

    private static final Logger log = LoggerFactory.getLogger(MessageSendTest.class);

    private RedisMessagePublisher redisMessagePublisher;

    public MessageSendTest(RedisMessagePublisher redisMessagePublisher) {

        this.redisMessagePublisher = redisMessagePublisher;

    }

    /**
     * 写入数据事件
     * @param message
     */
    public void write(Object message){
        redisMessagePublisher.write(Channel.TEST_CHANNEL, message);
    }

    /**
     * 更新数据事件
     * @param message
     */
    public void update(Object message){
        redisMessagePublisher.update(Channel.TEST_CHANNEL, message);
    }

    /**
     * 删除数据事件
     * @param message
     */
    public void delete(Object message){
        redisMessagePublisher.delete(Channel.TEST_CHANNEL, message);
    }

    /**
     * 刷新数据事件
     * @param message
     */
    public void refresh(Object message){
        redisMessagePublisher.refresh(Channel.TEST_CHANNEL);
    }


}
